<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="2" />
<title>制度管理</title>
<!--  通用情况下 不引入 js css  表单验证  js 放置到页面中     -->
<script charset="utf-8" src="${ctx}/KindEditor/kindeditor.js"></script>
<script>
	$(document).ready(function() {
		 //为第一个文本框获得焦点
		  $("#title").focus();
		 //绑定事件控件
	     $("#publishDate").addClass("Wate").bind("click", function(){
	     WdatePicker({skin:'whyGreen',minDate:'2000-10-01',maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'});});
				
		 //绑定工具栏到表单上
		 KE.show({  
			  id : 'editor_id'   
			  });
		 //验证
		 $("#inputForm").validate({
			 rules:{
				 title:{
					 required:true,
				 },
				 userId:{
					 required:true,
				 }
			 },
			 messages:{
				 title:{
					 required:"必须填写公告标题！"
				 },
				 userId:{
					 required:"请您登录后操作！"
				 }
			 }
		 });
	});
	</script>
</head>
<body>
<form action="${ctx }/asset/message/regulations!save.action" method="post" id="inputForm"
	class='yform' enctype="multipart/form-data">
<div id="caption" ><h6>${title}制度发布</h6></div>
<table class="noborder">
	<tr class="type-title">
	</tr>
	<tr class="type-text">
		<td>制度标题</td>
		<td><input name="id" type="hidden" value="${id}" /> <input
			id="title" name="title" type="text" value="${title}" /></td>
		<td>发布日期</td>
		<td><input id="publishDate" name="publishDate" type="text"
			value="${publishDate}" /></td>
	</tr>
	<tr class="type-text">
		<td>发布人</td>
		<td><c:choose>
			<c:when test="${id==null}">
				<input type="text" id="userId" name="userId"
					value="${user.userName}" readonly="readonly" />
			</c:when>
			<c:otherwise>
				<input type="text" id="publishPersons" name="publishPersons"
					value="${publishPerson.userName}" readonly="readonly" />
			</c:otherwise>
		</c:choose></td>

		<td>发布部门</td>
		<td>
		<pt:labels type="insideOrgDept" name="deptId"
			prompt="全部" default="${department.id}">
		</pt:labels>
		</td>
	</tr>
	<tr>
		<td>制度类型</td>
		<td>
		<pt:code name="regulationType" category="2021" default="${regulationType}" ></pt:code>
		</td>
		<td>关键字</td>
		<td><input type="text" name="keyword" value="${keyword}" /></td>
	</tr>
	<tr class="type-text">
		<td>发布范围</td>
		<td colspan="3"><input type="text" name="publishScope"
			value="${publishScope}" /></td>
	</tr>
	<tr>
		<td>附件</td>
		<td colspan="3"><input  type="file" name="attachmention.upfile" size="40"
			value="浏览" /></td>
	</tr>
	<c:if test="${not empty attachment.id}">
				<tr id="attachment">
				<td>已有附件</td>
				<td colspan="3">
				<a title="下载"
					href="${ctx}/servlet/annex?id=${attachment.id}">${attachment.upfileFileName}</a>
				<span onclick="deleteAttachment('${attachment.id}')" class="delete" title="删除附件"></span>
				</td>
			</tr>
	</c:if>
	<tr class="type-text">
		<td>发布内容</td>
		<td colspan="3"><textarea id="editor_id" rows="8" cols="50"
			name="publishContent" style="width: 720px; height: 360px">${publishContent}</textarea>
		</td>
	</tr>
	
</table>
<div class="type-button"><input   type="submit"
	class="submit" value="提交" />&nbsp; <input   type="button"
	value="返回" class="reset" onclick="history.back()" /></div>
</form>
</body>
</html>
